package com.qingke.oms.pojo;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="user")
public class User {
	@Id
	@Column(name="id")
	private int id;
	
	@Column(name="name")
	private String name;
	
	@Column(name="balance")
	private double balance;
	
	@OneToMany(mappedBy="owner",fetch=FetchType.LAZY)
	private Set<Shop> shops;
	
	@OneToMany(mappedBy="customer",fetch=FetchType.LAZY)
	private Set<Order> orders;
	
	@OneToMany(mappedBy="user",fetch=FetchType.LAZY)
	private Set<Recharge> recgaeges;
	
	@OneToMany(mappedBy="customer",fetch=FetchType.LAZY)
	private Set<ShoppingCart> shoppingCarts;
	
	public User(){
		
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public double getBalance() {
		return balance;
	}
	public void setBalance(double balance) {
		this.balance = balance;
	}
	
	public Set<Shop> getShops() {
		return shops;
	}
	public void setShops(Set<Shop> shops) {
		this.shops = shops;
	}
	public Set<Order> getOrders() {
		return orders;
	}
	public void setOrders(Set<Order> orders) {
		this.orders = orders;
	}
	public Set<Recharge> getRecgaeges() {
		return recgaeges;
	}
	public void setRecgaeges(Set<Recharge> recgaeges) {
		this.recgaeges = recgaeges;
	}
	public Set<ShoppingCart> getShoppingCarts() {
		return shoppingCarts;
	}
	public void setShoppingCarts(Set<ShoppingCart> shoppingCarts) {
		this.shoppingCarts = shoppingCarts;
	}
	@Override
	public String toString() {
		return "[id]=" + id + ", [name]=" + name ;
	}
	
}
